﻿<navigation:Page x:Class="GoogleSearch.Views.Search"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="1100" d:DesignHeight="650"
           Title="Search Page" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">
	<navigation:Page.Resources>
		<Storyboard x:Name="StoryboardInit">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardAfterSearchPressed">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardAfterSearchCompleted">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="grid1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</navigation:Page.Resources>
    <toolkit:BusyIndicator x:Name="BusyIndicator" DisplayAfter="0:0:1" Background="Transparent">
        <Grid x:Name="LayoutRoot">
            <Grid HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="1065">
            	<Grid.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</Grid.RenderTransform>
            	<Grid.Projection>
            		<PlaneProjection/>
            	</Grid.Projection>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50*" />
                    <RowDefinition Height="550*" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition x:Name="ColumnLeft" Width="600" MaxWidth="900"/>
                    <ColumnDefinition x:Name="ColumnRight" Width="500*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.ColumnSpan="1" HorizontalAlignment="Left" Name="stackPanel1" VerticalAlignment="Top" Margin="0" Orientation="Horizontal" Width="592" d:LayoutOverrides="GridBox">
                    <TextBox Style="{StaticResource TextBoxStyle}"  Name="SearchTextBox" Width="488" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" KeyDown="SearchTextBox_KeyDown"  Margin="10,10,10,0" Opacity="0.8" Background="{x:Null}" Foreground="#FFF1F1F1"></TextBox>
                    <Button Cursor="Hand" Content="Search" Height="30" HorizontalAlignment="Left" Margin="0,10,0,0" x:Name="SearchButton" VerticalAlignment="Top" Width="75" Click="SearchButton_Click" />
                </StackPanel>
                <!--<data:DataGrid AutoGenerateColumns="True" Grid.Row="1" HorizontalAlignment="Left" Margin="10" Name="Results" VerticalAlignment="Top" />-->
                <ScrollViewer Margin="0,10,0,0" Grid.Row="1" Grid.Column="0" Style="{StaticResource ScrollViewerStyle}" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" BorderThickness="0">
                    <ItemsControl Margin="10" Name="Results">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="0,20">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" VerticalAlignment="Top" Margin="8" Background="LightGray">
                                        <Image Width="120" Height="90" Source="{Binding Path=ThumbnailUrl, Mode=OneWay}" />
                                    </Border>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="0,4,0,0">
                                        <TextBlock x:Name="Title" FontWeight="Bold" Text="{Binding Path=TitleNoFormatting, Mode=OneWay}" Cursor="Hand" />
                                        <TextBlock x:Name="Content" TextWrapping="Wrap" Text="{Binding Path=Content, Mode=OneWay}" />
                                        <HyperlinkButton TargetName="_blank" Content="{Binding Path=VisibleUrl, Mode=OneWay}" NavigateUri="{Binding Path=Url, Mode=OneWay}" HorizontalAlignment="Left" />
                                        <HyperlinkButton Content="Preview" CommandParameter="{Binding Path=Url, Mode=OneWay}" HorizontalAlignment="Left" Cursor="Hand" Click="HyperlinkButton_Click" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>                
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"  Grid.Column="0" Grid.Row="2">
                    <Button Content="Previous page" Visibility="Collapsed"  x:Name="PrevPageBtn" Width="120" Click="PrevPageBtn_Click" Margin="0,0,10,0" Cursor="Hand"></Button> <Button x:Name="NextPageBtn" Width="120" Visibility="Collapsed" Content="Next page" Click="NextPageBtn_Click" Cursor="Hand"></Button>
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="1">
                    <WebBrowser x:Name="WebBrowserQuick" Width="400" Margin="10,0" VerticalAlignment="Center" Height="400" Visibility="Collapsed" />                    
                </StackPanel>
            </Grid>
        </Grid>
    </toolkit:BusyIndicator>
</navigation:Page>
